The present invention relates generally to the field of database systems. More specifically, the present invention is related to a method and system for optimizing the order of execution of multiple join operations.
Relational databases systems allow a database user to enter queries into the database and return the data that meets the conditions of the query. The data present within the database system is in one or more tables or relations. Each relation consists of a number of records or tuples containing specific information possibly grouped in some ordered sequence. Each tuple consists of one or more fields called attributes. In any single attribute of a tuple there can be only a single value. However, each tuple can have a different value for the same attribute.
Some characteristics of a database relation are typically maintained. For example, the database system may maintain the cardinality, the density and the number of distinct values of each relation. Cardinality is the number of tuples or records in a table, especially the number of rows of a table. The number of distinct values is the number of distinct values of a given attribute or set of attributes. The density is the average number of tuples per distinct value.